Open
Conversation
Vinograduss
reviewed
Nov 24, 2021
| ${INC_DIR}/find_letters.h | ||
| ${SRC_DIR}/find_letters.c) | ||
|
|
||
| add_library(multi_compute_matrix MODULE |
| #include <sys/mman.h> | ||
| #include <sys/wait.h> | ||
| #include <time.h> | ||
| #include <dlfcn.h> |
There was a problem hiding this comment.
много инклюдов в публичном хедере, здесь должны подключаться только необходимые заголовки6 остальные в c файле
| : "0" (eax), "2" (ecx) | ||
| : ); | ||
|
|
||
| return eax; |
|
|
||
| int date_in_key(date_frame date) { | ||
|
|
||
| int value = (((date.year)*12 + date.month)*30 + date.day); |
There was a problem hiding this comment.
12, 30 нужно было обозначит через константы, так как сейчас они магические числа
| while (left <= right) | ||
| { | ||
| int mid = (left + right) / 2; | ||
| if (k[mid] == NULL) { |
| for (int i=start;i<=end;++i) { | ||
| for (int j=0;j<letters[i]->number_ecipient;++j){ | ||
| if (letters[i]->ecipient_id[j] == number_user) { | ||
| for (int o=0;o<9;++o) { |
There was a problem hiding this comment.
не хвататет пробелов, 9 - надо вынести в контанты
| return find_topics; | ||
| } | ||
|
|
||
| str_topics* multiprocess_find_topic(letter** letters, int start,int end, int number_user) { |
There was a problem hiding this comment.
реализации должны находится в разных c файлах
| } else { | ||
| return 0; | ||
| } | ||
| } |
There was a problem hiding this comment.
тесты должны быть в отдельном файле, эту функции стоило назвать check или equal
| @@ -0,0 +1,80 @@ | |||
| #include "../include/testy/find_letters.h" | |||
There was a problem hiding this comment.
относительные пути не очень хорошо, это можно решить с помощью cmake
|
|
||
| TEST(binary_search, ok) { | ||
| letter* let[200]; | ||
| testing_letters_el(let,200); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.